import React, { Component } from 'react';
import {connect} from 'react-redux';
import { actions } from './_index.js';

class View extends Component {
    componentDidMount(){
        const {onAxiosFn} = this.props;
        const cfg = {
            url:'/home/mediareports',
            cfg:{
                page_number:'1',
                page_size:'20'
            },
            headers:""
        }
        onAxiosFn('请求拼多多',cfg)
    }
    render(){
        return(
            <React.Fragment>
                <div className="m">
                    这是redux ajax 请求页面
                </div>
            </React.Fragment>
        )
    }
}
const mapStateToProps = (state) =>{
    return {
        isList:state
    }
}
const mapDispatchToProps = (dispatch, ownProps) => {
	return {
        onAxiosFn:(text,getCfg)=>dispatch(actions.getApi(text,getCfg,dispatch))
	}
};







export default connect(mapStateToProps,mapDispatchToProps)(View);
